#!/bin/bash
set -e
. tests/lib

t-archive pari-extra 3-1
t-git pari-extra 3-1

t-dgit clone $p

cd $p
t-cloned-fetched-good

v=3-2~dummy1
t-apply-diff 3-1 $v
debcommit -a

t-refs-same-start
t-ref-head

t-dgit-rpush () {
	t-dgit "$@" --ssh=$troot/ssh rpush r-build:$tmp/$p
}

mkdir $tmp/empty
cd $tmp/empty

t-expect-fail F:'error: looked for .dsc' \
t-dgit-rpush -cdgit.default.rpush-subcmd=built

t-expect-fail F:'error: looked for .dsc' \
t-dgit-rpush -cdgit.default.push-subcmd=built

cd $tmp/$p

t-dgit --dpkg-buildpackage:-d build

cd $tmp/empty

t-expect-fail F:'dgit rpush, but dgit.default.[r]push-subcmd set to reject' \
t-dgit-rpush -cdgit.default.rpush-subcmd=reject

t-expect-fail F:'dgit rpush, but dgit.default.[r]push-subcmd set to reject' \
t-dgit-rpush

t-dgit-rpush -cdgit.default.rpush-subcmd=built

cd $tmp/$p
t-pushed-good dgit/sid

t-ok
